package Pokero;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextPane;

public class WinnerFrame  extends JFrame implements ActionListener {
	private JFrame frame;
    public static JTextPane text;
    private JButton exit;
    
    
    public WinnerFrame(String result) {
    	//okno
        super("Wygrana!");
        frame = new JFrame();
        setVisible(true);
        setSize(400,200);
        setLayout(new FlowLayout());
        setLocationRelativeTo(null);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        text = new JTextPane();
        
        Font f = new Font(Font.SANS_SERIF, 5, 17);
        text.setEditable(false);
        //text.setLocation(500, 200);
        //text.setSize(500, 500);
        text.setForeground(Color.RED);
        text.setBackground(null);
        //text.setBounds( 0, 0, 0, 600 );
        //text.setPreferredSize( new Dimension( 700, 600 ) );  
        text.setFont(f);
        text.setText(result);
        
        add(text);
        
        
        //exit
        exit = new JButton("Wyjscie");
        exit.setVisible(true);
        exit.addActionListener(this);
        add(exit);
        
        
    }
    
    
    
    
	@Override
	public void actionPerformed(ActionEvent e) {
		Object source = e.getSource();	   
        
        if(source == exit) {
                dispose();
        }
	}
}
